<div class="generalText">

<h2>JSON speed up AJAX</h2>

The JavaScript Object Notation, or JSON, is a lightweight syntax for representing data. 
JSON has structure with nesting of data elements, just as XML does. JSON is also 
text-based and use Unicode. It is just as readable by humans as XML is. Here comes 
a simple example for Json:

<br><br>
<font face="Courier New">
&nbsp;&nbsp;    {"totalCount":2,<br>
&nbsp;&nbsp;&nbsp;    "results":[{"bh":"100","sm":"hello"},{"bh":"101","sm":"me" }]}
</font>

<br><br>
The big different about JSON and XML is that JSON is a subset of JavaScript. 
I can use JavaScript's own compiler to do just that by calling eval. Parsing 
JSON is a one-liner! Moreover, navigating an object synthesized from JSON is 
identical to navigating any JavaScript object. It's far easier than navigating 
through the DOM tree.

<br><br>
In ExtJS, JSON are widely used. One example is to using JSON as function parameters 
in their API. For example:
<br><br>
<font face="Courier New">
&nbsp;&nbsp;   var viewport = new Ext.Viewport({<br>
&nbsp;&nbsp;&nbsp;        layout:'border',<br>
&nbsp;&nbsp;&nbsp;        items:[<br>
&nbsp;&nbsp;&nbsp;&nbsp;            northPanel,<br>
&nbsp;&nbsp;&nbsp;&nbsp;            westPanel,<br>
&nbsp;&nbsp;&nbsp;&nbsp;            centalPanel<br>
&nbsp;&nbsp;&nbsp;         ]<br>
&nbsp;&nbsp;    });<br>
</font>

<br>
With JSON as function parameter. Paremeters can be passed without order and
only the necessary parameters need to be pass to the function.
<br><br>

</div>

<link href="/public/css/window/doc.css" rel="stylesheet" type="text/css">
